//directive.directive('dropdown',[function(){
//    return {
//        restrict:'E',
//        transclude:true,
//        replace:true,
//        scope:{
//            ngModel:'='
//        },
//        template:'<div class="ui dropdown">'+
//        '<i class="dropdown icon"></i>'+
//        '<div class="default text" ng-bind="ngModel">{{}}</div>'+
//        '<div class="menu" ng-transclude></div></div>',
//        link:function($scope,$element,$attrs){
//            $element.dropdown({
//                onChange:function(value, text){
//                    var ngModel=$element.attr('ng-model');
//                    if(stringUtil.isBlank(ngModel)) {
//                        return;
//                    }
//
//                    $scope['ngModel']=value;
//                    $scope.$apply();
//                }
//            });
//        }
//    }
//}]);

directive.directive('dropdown',[function(){
    return {
        restrict:'E',
        transclude:true,
        replace:true,
         scope:{
            ngModel:'='
        },
        template:'<div class="ui dropdown">'+
            '<i class="dropdown icon"></i>'+
            '<div class="default text"></div>'+
            '<div class="menu" ng-transclude></div></div>',
        link:function($scope,$element,$attrs){
            $element.find('.default .text').html($scope['ngModel']);
            $element.dropdown({
                onChange:function(value, text){
                    var ngModel=$element.attr('ng-model');
                    if(stringUtil.isBlank(ngModel)) {
                        return;
                    }

                    $scope['ngModel']=value;
                    $scope.$apply();
                }
            });
        }
    }
}]);

directive.directive('dropdownItem',[function(){
    return {
        restrict:'E',
        replace:true,
        transclude:true,
        template:'<div class="item" ng-transclude></div>'
    }
}]);